package com.example.file_explorer.service;

import cn.dev33.satoken.stp.StpUtil;
import org.springframework.stereotype.Service;

@Service
public class LoginService implements Login{
    @Override
    public boolean login(String username, String password) {
        if (username.equals("root") && password.equals("12345677")) {
            StpUtil.login(1);
            return true;
        }
        return false;
    }

    @Override
    public void logout() {
        StpUtil.logout(1);
    }

    @Override
    public boolean loginCheck() {
        return StpUtil.isLogin();
    }
}
